<template>
  <div>
    <!-- 主页的  轮播图 -->

    <swiper :lunbotu="lunbotu" :isfull="true"></swiper>
    <!-- <mt-swipe :auto="4000">
      <mt-swipe-item v-for="item in lunbotu" :key="item.id">
        <img :src="item.img" alt>
      </mt-swipe-item>
    </mt-swipe> -->

    <!-- 九宫格 布局 -->
    <ul class="mui-table-view mui-grid-view mui-grid-9">
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <router-link to="/tabbar/newlist">
            <img src="./../images/menu1.png" alt="">
           <div class="mui-media-body">新闻资讯</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <router-link to="/tabbar/photoshare">
          <img src="./../images/menu2.png" alt="">
          <div class="mui-media-body">图片分享</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <router-link to="/tabbar/goodslist">
          <img src="./../images/menu3.png" alt="">
          <div class="mui-media-body">商品购买</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <router-link to="">
          <img src="./../images/menu4.png" alt="">
          <div class="mui-media-body">留言反馈</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <router-link to="">
          <img src="./../images/menu5.png" alt="">
          <div class="mui-media-body">视屏专区</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <router-link to="">
          <img src="./../images/menu6.png" alt="">
          <div class="mui-media-body">联系我们</div>
        </router-link>
      </li>  
    </ul>
  </div>
</template>

<script>
// 这里 是写逻辑的
import Vue from "vue";
// 引入 轮播图插件
import swiper from "./../comments/swiper.vue"
// 获取轮播图的图片 首先需要发送请求 ，获取数据
// 引入 vue-resource 发送请求
// import VueResource from "vue-resource";
// // 将VueResource 安装到 Vue中
// Vue.use(VueResource);


// 发送请求，获取数据
export default {
  data() {
    return {
      lunbotu: [] //设置 获取 发送请求获取的 轮播图地址
    };
  },
  created() {
    this.getlunbotu();
  },
  methods: {
    getlunbotu() {
      this.$http
        .get("api/getlunbo")
        .then(result => {
          if (result.body.status == 0) {
            this.lunbotu = result.body.message;
          } else {
            Toast("轮播图加载失败...");
          }
        });
    }
  },
  components:{
    swiper
  }
};
</script>

<style scoped lang="less">
// .mint-swipe {
//     height: 150px;
//   .mint-swipe-item {
//     &:first-of-type {
//       background-color: pink;
//     }
//     &:nth-of-type(2) {
//       background-color: yellow;
//     }
//     &:nth-of-type(3) {
//       background-color: hotpink;
//     }
//     img {
//       width: 100%;
//       height: 100%;
//     }
//   }
// }
// 九宫格 布局
ul{
    img{
        width: 60px;
        height: 60px;
    }
}
.mui-grid-view.mui-grid-9{
    background-color: #fff;
    border: none;
}
.mui-grid-view.mui-grid-9 .mui-table-view-cell{
    border: none;
}

</style>
